<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/util_file/common.jspf"%>  
<script type="text/javascript" src="/jeons/js/jquery.nyroModal.custom.js"></script>
<link rel="stylesheet" href="/jeons/css/nyroModal/nyroModal.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/jeons/css/default.css" type="text/css" media="screen" />
<script type="text/javascript">
$(document).ready( function(){

 $("#BtnInsertData").click( function(){
	$.get('/jeons/buildqna/insert?bdtype='+$('#qna_bdtype').val()+'&bdno='+$('#qna_bdno').val(),function(data){
		$("#subpage_qna").replaceWith(data);
	});
}); 
//페이지 이동
 function goPage(page){
	$.get('/jeons/buildqna/index?page='+page,function(data){
		$("#subpage_qna").replaceWith(data);
	}); 
} 	


	 $("[name=readView]").click( function(){
		$.get('/jeons/buildqna/view?qnano='+$(this).attr('qnano'),function(data){
			$("#subpage_qna").replaceWith(data);
		}); 
	}); 
	
	//레이어
 	$(".nm").nm({
		sizes : {
			minW : 400,
			maxW : 500,
			minH : 200,
			maxH : 200
		}
	});
	
	
});
</script>
<div id="default">
<div id="subpage_qna">
	<table  border="0" width="675px">
		<tr>
			<td colspan="5" bgcolor="#000000" height="1"></td>
		</tr>
		<tr>
			<th align="center">번호</th>
			<th align="center" width="400px">제목</th>
			<th align="center">공개여부</th>
			<th align="center">현재상태</th>
			<th align="center">작성일</th>
		</tr>
		<tr>
			<td colspan="4" bgcolor="#ffffff" height="1"></td>
		</tr>
		<c:forEach items="${qnadata}" var="item" varStatus="status">
		<tr>
			<td align="center">${count - (item.page-1)*10 - status.index}</td>
			<c:if test="${item.open != null}">
			<td  align="center">
				<a href="/jeons/buildqna/checkpasswd?qnano=${item.qnano}&board_type=read" class="nm">${item.title}</a> 
			</td>	
			</c:if>
			<c:if test="${item.open == null}">
			<td name="readView" qnano="${item.qnano}" align="center">
				${item.title}
				</td>
			</c:if>
			<td align="center">
				<c:if test="${item.open != null}">
					<img src="/jeons/images/key.gif"/>
				</c:if>
			</td>
			<td align="center">
			<c:if test="${item.status == 'confirmation'}">
					확인
				</c:if>
				<c:if test="${item.status != 'confirmation'}">
					대기중
				</c:if>
			</td>
			<td align="center"><fmt:formatDate value="${item.rg}" pattern="yyyy-MM-dd hh:mm:ss"/></td>
		</tr>
		</c:forEach>
		<tr>
			<td colspan="5" bgcolor="#ffffff" height="1"></td>
		</tr>
		<tr>
			<td colspan="5" bgcolor="#ffffff" height="1"></td>
		</tr>
	</table>
<div align="center">
	${page}
</div>		
<div align="right">
	<button type="button" id="BtnInsertData">글쓰기</button>
</div>
</div>	
</div>
